$(function () {
    vm.loadProgram();
});
var vm = new Vue({
    el: '#rrapp',
    data: {
        score : {
            score : 0,
            raterId : 0,
            programId : 0
        },
        programs: [],
        msg : '',
    },
    methods: {
        commitScore : function () {
            $.ajax({
                url : "../programScore",
                type : 'POST',
                contentType:"application/json;charset=UTF-8",
                data : JSON.stringify(vm.score),
                success : function (result) {
                    vm.msg = result.msg;
                    alert(result.msg);
                }
            })
        },
        loadProgram : function () {
            $.ajax({
                url : "../loadProgram?t=" + $.now(),
                type : 'get',
                success : function (result) {
                    vm.programs = result.programs;
                }
            })
        }
    }
});